#include "Link_BiTree.h"

int PrintElement(ElemType c);

int main() {
    BiTree T;	//declaration

    printf("\nInput a tree : \n");
    //用例:ABD..EH...CF.I..G..\n
    CreateBiTree(&T);	//创建


//    printf("\nPreOrderTraverse : ");

    PreOrderTraverse(T, &PrintElement);	//先序递归遍历
    printf("\n");\

    //销毁树
//    DestroyBiTree(&T);

    //清空树
    ClearBiTree(&T);

//    InOrderTraverse(T,&PrintElement);//中序递归遍历
//    printf("\n");


//    PostOrderTraverse(T,&PrintElement);//后序递归遍历


//    printf("\nnumOfleavse:%d\n", NumOfLeaves(T));
//    printf("\n");


    PreOrderTraverse(T, &PrintElement);	//先序递归遍历
    printf("\n");\


//    getXthdataInPreOrderTravse(T,1);
//    for (int j = 0; j < strlen(arr); ++j) {
//        printf("\n%dth data in POT is %c\n",j+1, arr[j]);
//    }
    return 0;
}

int PrintElement(ElemType c){
    printf("%c ",c);
}